import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";


/** @type {import('eslint').Linter.Config[]} */
export default [
    {files: ["**/*.{js,mjs,cjs,ts}"]},
    {
        languageOptions: {globals: globals.browser}
    },
    pluginJs.configs.recommended,
    ...tseslint.configs.recommended,
    {
        rules: {
            "@typescript-eslint/no-explicit-any": "error", // 禁止使用 any 类型
            "@typescript-eslint/explicit-module-boundary-types": "off", // 允许不声明函数返回类型
            "@typescript-eslint/no-unused-vars": [
                "error",
                { argsIgnorePattern: "^_" },
            ], // 禁止未使用的变量，允许未使用的参数前缀为 _
            "@typescript-eslint/consistent-type-assertions": "error", // 强制一致的类型断言
        },
    },
];